package com.example.springbootneo4j.service;

import com.example.springbootneo4j.mapper.DataMapper;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.neo4j.driver.Session;
import org.neo4j.driver.Transaction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author HUAWEI
 * @version 1.0.0
 * @ClassName DataService
 * @Description
 * @createTime 2024/11/13 20:45
 */
@Service
@Transactional(propagation = Propagation.REQUIRED)
public class DataService {
    @Autowired
    DataMapper dataMapper;

    List selectData(String uName) {
        List<Object> objects = dataMapper.selectData(uName);
        for (int i = 0; i < 10; i++) {
            List<Object> os = dataMapper.selectData(uName + ""+i);
            objects.addAll(os);
        }
        return objects;
    }
}
